const Router = require("koa-router")
const Server = require('./server')
const Check = require('./check')
const { auth } = require('@/lib/auth')

/**
 * 路由对象
 * @type {Router}
 */
const router = new Router({
	prefix: '/dashboard'
})

/**
 * 获取所有数据总个数
 */
router.get("/data-count", auth, async (ctx, next) => {
	Check.dataCount(ctx)
	const data = await Server.dataCount(ctx)
	ctx.sendSuccess(data)
})

module.exports = router
